<?php
//JFactory :: getDocument()->addScript(JURI :: base() . 'media/system/js/mootools.js');

// no direct access
defined('_JEXEC') or die('Restricted access');

require_once ('administrator/components/com_jbschedule/utils'.DS.'common_utils.php');

$settings = Utils::getSettings();

JFactory :: getDocument()->addStyleSheet('components/com_jbschedule/media/css/themes/'.$settings->theme.'.css');
JFactory :: getDocument()->addScript('components/com_jbschedule/media/js/overlib.js');
JFactory :: getDocument()->addScript('components/com_jbschedule/media/js/overlib_shadow.js');
JFactory :: getDocument()->addScript('components/com_jbschedule/media/js/date.format.js');

echo $this->calendar;

//	JFactory :: getDocument()->addScriptDeclaration("alert('Hello !')")

//	require_once (JPATH_COMPONENT . DS . 'utils' . DS . 'jbs_calendar.php');

/*	if ($this->items != null) {
		foreach ($this->items as $item) {
			echo $item->subject . "<br>";
		}
	}*/
/*// Construct a calendar to show the current month
$cal = new Calendar;

Start Day  	Value
Sunday 	0
Monday 	1
Tuesday 	2
Wednesday 	3
Thursday 	4
Friday 	5
Saturday 	6

$cal->setStartDay(1);

// First, create an array of month names, January through December
$vnMonths = array (
	"Tháng một",
	"Tháng hai",
	"Tháng ba",
	"Tháng tư",
	"Tháng năm",
	"Tháng sáu",
	"Tháng bảy",
	"Tháng tám",
	"Tháng chín",
	"Tháng mười",
	"Tháng mười một",
	"Tháng mười hai"
);
// Then an array of day names, starting with Sunday
$vnDays = array (
	"CN",
	"Hai",
	"Ba",
	"Tư",
	"Năm",
	"Sáu",
	"Bảy"
);
$cal->setMonthNames($vnMonths);
$cal->setDayNames($vnDays);

echo $cal->getCurrentMonthView();
echo $cal->getMonthView(11, 1980);


Start Month  	Value
January 	1
February 	2
March 	3
April 	4
May 	5
June 	6
July 	7
August 	8
September 	9
October 	10
November 	11
December 	12

$cal->setStartMonth(4);
echo $cal->getCurrentYearView();
*/
// If no month/year set, use current month/year
/*$d = getdate(time());
$month = empty ($_GET['month']) ? empty ($_POST['month']) ? $d['mon'] : $_POST['month'] : $_GET['month'];
$year = empty ($_GET['year']) ? empty ($_POST['year']) ? $d['year'] : $_POST['year'] : $_GET['year'];

$cal = new JBSCalendar;
$cal->setEventList($this->items);
$this;
echo $cal->getMonthHTML4JBS($month, $year);*/
?>